<?php
error_reporting(E_ALL ^ E_NOTICE);

set_time_limit(0);

$db=mysql_connect("localhost","root","root"); 
mysql_select_db('faithwar',$db); 

$db2=mysql_connect('192.168.0.17','root','root'); 
mysql_select_db('faithwar',$db2); 

$db3=mysql_connect("192.168.1.246:5029","root","root"); 
mysql_select_db('faithwar',$db3); 

$dateTime = date("Y-m-d",strtotime("-1 day"));

$deviceid_query =  mysql_query("SELECT DISTINCT deviceid FROM `faithwar` ",$db);

while($deviceid = mysql_fetch_array($deviceid_query))
{

      //firstlogindata DISTINCT
    $firstlogindata_query = mysql_query("SELECT DISTINCT deviceid,firstlogindata  FROM  faithwar  where  deviceid ='$deviceid[deviceid]'",$db3);
    $firstlogindata = mysql_fetch_array($firstlogindata_query);

     //LastLogin 
    $LastLogin_query = mysql_query("SELECT DISTINCT deviceid,LastLogin FROM  faithwar  where  deviceid ='$deviceid[deviceid]'  ORDER BY date DESC LIMIT 1",$db3);
    $LastLogin = mysql_fetch_array($LastLogin_query);

     //LastLoginIp  最后登录ip
    $LastLoginIp_query = mysql_query("SELECT DISTINCT deviceid,str1  FROM  faithwar  where  deviceid ='$deviceid[deviceid]'  ORDER BY date DESC LIMIT 1",$db3);
    $LastLoginIp = mysql_fetch_array($LastLoginIp_query);

    //prestige 威望
    $prestige_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $prestige = mysql_fetch_array($prestige_query);

    //prestigeLevel 威望等级
    $prestigeLevel_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $prestigeLevel = mysql_fetch_array($prestigeLevel_query);

    //warvictory 战功
    $warvictory_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $warvictory = mysql_fetch_array($warvictory_query);

    //TownNum 城镇数量
    $TownNum_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $TownNum = mysql_fetch_array($TownNum_query);

    //goldIncome 金币收入
    $goldIncome_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $goldIncome = mysql_fetch_array($goldIncome_query);

    //goldUsed 金币消耗
    $goldUsed_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $goldUsed = mysql_fetch_array($goldUsed_query);

    //goldNow 现有金币
    $goldNow_query = mysql_query("SELECT DISTINCT deviceid,gold  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $goldNow = mysql_fetch_array($goldNow_query);

    //TcUsedNum 消费水晶
    $TcUsedNum_query = mysql_query("SELECT DISTINCT deviceid,TcUsedNum  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $TcUsedNum = mysql_fetch_array($TcUsedNum_query);

    //TcUsedNum 现有水晶
    $TcInventoryNum_query = mysql_query("SELECT DISTINCT deviceid,TcInventoryNum  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $TcInventoryNum = mysql_fetch_array($TcInventoryNum_query);

    //TcUsedNum 总充值
    $rechargeTotal_query = mysql_query("SELECT sum(money)  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $rechargeTotal = mysql_fetch_array($rechargeTotal_query);

    //rechargeToday 今日充值
    $rechargeToday_query = mysql_query("SELECT sum(money)  FROM  faithwar  where  deviceid ='$deviceid[deviceid]'  and date ='$dateTime' ORDER BY date DESC LIMIT 1",$db);
    $rechargeToday = mysql_fetch_array($rechargeToday_query);

    //rechargeTotalTime 总充值次数
    $rechargeTotalTime_query = mysql_query("SELECT sum(action =2)  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $rechargeTotalTime = mysql_fetch_array($rechargeTotalTime_query);

    //rechargeTodayTime 今日充值次数
    $rechargeTodayTime_query = mysql_query("SELECT sum(action =2)  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' and date ='$dateTime'  ORDER BY date DESC LIMIT 1",$db);
    $rechargeTodayTime = mysql_fetch_array($rechargeTodayTime_query);

    //technologyT1 科技 t1
    $technologyT1_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $technologyT1 = mysql_fetch_array($technologyT1_query);

    //technologyT2 科技 t2
    $technologyT2_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $technologyT2 = mysql_fetch_array($technologyT2_query);

    //technologyT3 科技 t3
    $technologyT3_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $technologyT3 = mysql_fetch_array($technologyT3_query);

    //technologyT4 科技 t4
    $technologyT4_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $technologyT4 = mysql_fetch_array($technologyT4_query);

    //technologyT5 科技 t5
    $technologyT5_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $technologyT5 = mysql_fetch_array($technologyT5_query);

    //technologyT6 科技 t6
    $technologyT6_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $technologyT6 = mysql_fetch_array($technologyT6_query);

    //technologyT7 科技 t7
    $technologyT7_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $technologyT7 = mysql_fetch_array($technologyT7_query);

    //technologyT8 科技 t8
    $technologyT8_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $technologyT8 = mysql_fetch_array($technologyT8_query);

    //technologyT9 科技 t9
    $technologyT9_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $technologyT9 = mysql_fetch_array($technologyT9_query);

    //technologyT10 科技 t10
    $technologyT10_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $technologyT10 = mysql_fetch_array($technologyT10_query);

    //technologyT11 科技 t11
    $technologyT11_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $technologyT11 = mysql_fetch_array($technologyT11_query);

    //technologyT12 科技 t12
    $technologyT12_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $technologyT12 = mysql_fetch_array($technologyT12_query);

    //technologyT13 科技 t13
    $technologyT13_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $technologyT13 = mysql_fetch_array($technologyT13_query);

    //technologyT14 科技 t14
    $technologyT14_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $technologyT14 = mysql_fetch_array($technologyT14_query);

    //technologyT15 科技 t15
    $technologyT15_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $technologyT15 = mysql_fetch_array($technologyT15_query);

    //heroNum 英雄数量
    $heroNum_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroNum = mysql_fetch_array($heroNum_query);

    //heroH1level 英雄 h1 级别
    $heroH1level_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH1level = mysql_fetch_array($heroH1level_query);

    //heroH1physical 英雄 h1 体力
    $heroH1physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH1physical = mysql_fetch_array($heroH1physical_query);

    //heroH1experience 英雄 h1 经验
    $heroH1experience_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH1experience = mysql_fetch_array($heroH1experience_query);

    //heroH1experience 英雄 h1 经验
    $heroH1experience_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH1experience = mysql_fetch_array($heroH1experience_query);

    //heroH1generals 英雄 h1 统率力
    $heroH1generals_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH1generals = mysql_fetch_array($heroH1generals_query);

    //heroH1power 英雄 h1 力量
    $heroH1power_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH1power = mysql_fetch_array($heroH1power_query);

    //heroH1agile 英雄 h1 敏捷
    $heroH1agile_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH1agile = mysql_fetch_array($heroH1agile_query);

    //heroH1brains 英雄 h1 智力
    $heroH1brains_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH1brains = mysql_fetch_array($heroH1brains_query);

    //heroH1state 英雄 h1 状态
    $heroH1state_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH1state = mysql_fetch_array($heroH1state_query);

    //heroH1forces 英雄 h1 兵力
    $heroH1forces_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH1forces = mysql_fetch_array($heroH1forces_query);

    //heroH2level 英雄 H2 级别
    $heroH2level_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH2level = mysql_fetch_array($heroH2level_query);

    //heroH2physical 英雄 H2 体力
    $heroH2physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH2physical = mysql_fetch_array($heroH2physical_query);

    //heroH2experience 英雄 H2 经验
    $heroH2physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH2experience = mysql_fetch_array($heroH2experience_query);

    //heroH2generals 英雄 H2 统率力
    $heroH2generals_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH2generals = mysql_fetch_array($heroH2generals_query);

    //heroH2power 英雄 H2 力量
    $heroH2power_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH2power = mysql_fetch_array($heroH2power_query);

    //heroH2agile 英雄 H2 敏捷
    $heroH2agile_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH2agile = mysql_fetch_array($heroH2agile_query);

    //heroH2brains 英雄 H2 智力
    $heroH2brains_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH2brains = mysql_fetch_array($heroH2brains_query);

    //heroH2state 英雄 H2 状态
    $heroH2state_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH2state = mysql_fetch_array($heroH2state_query);

    //heroH2forces 英雄 H2 兵力
    $heroH2forces_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH2forces = mysql_fetch_array($heroH2forces_query);

    //heroH3level 英雄 H3 级别
    $heroH3level_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH3level = mysql_fetch_array($heroH3level_query);

    //heroH3physical 英雄 H3 体力
    $heroH3physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH3physical = mysql_fetch_array($heroH3physical_query);

    //heroH3experience 英雄 H3 经验
    $heroH3physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH3experience = mysql_fetch_array($heroH3experience_query);

    //heroH3generals 英雄 H3 统率力
    $heroH3generals_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH3generals = mysql_fetch_array($heroH3generals_query);

    //heroH3power 英雄 H3 力量
    $heroH3power_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH3power = mysql_fetch_array($heroH3power_query);

    //heroH3agile 英雄 H3 敏捷
    $heroH3agile_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH3agile = mysql_fetch_array($heroH3agile_query);

    //heroH3brains 英雄 H3 智力
    $heroH3brains_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH3brains = mysql_fetch_array($heroH3brains_query);

    //heroH3state 英雄 H3 状态
    $heroH3state_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH3state = mysql_fetch_array($heroH3state_query);

    //heroH3forces 英雄 H3 兵力
    $heroH3forces_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH3forces = mysql_fetch_array($heroH3forces_query);

    //heroH4level 英雄 H4 级别
    $heroH4level_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH4level = mysql_fetch_array($heroH4level_query);

    //heroH4physical 英雄 H4 体力
    $heroH4physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH4physical = mysql_fetch_array($heroH4physical_query);

    //heroH4experience 英雄 H4 经验
    $heroH4physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH4experience = mysql_fetch_array($heroH4experience_query);

    //heroH4generals 英雄 H4 统率力
    $heroH4generals_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH4generals = mysql_fetch_array($heroH4generals_query);

    //heroH4power 英雄 H4 力量
    $heroH4power_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH4power = mysql_fetch_array($heroH4power_query);

    //heroH4agile 英雄 H4 敏捷
    $heroH4agile_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH4agile = mysql_fetch_array($heroH4agile_query);

    //heroH4brains 英雄 H4 智力
    $heroH4brains_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH4brains = mysql_fetch_array($heroH4brains_query);

    //heroH4state 英雄 H4 状态
    $heroH4state_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH4state = mysql_fetch_array($heroH4state_query);

    //heroH4forces 英雄 H4 兵力
    $heroH4forces_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH4forces = mysql_fetch_array($heroH4forces_query);

    //heroH5level 英雄 H5 级别
    $heroH5level_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH5level = mysql_fetch_array($heroH5level_query);

    //heroH5physical 英雄 H5 体力
    $heroH5physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH5physical = mysql_fetch_array($heroH5physical_query);

    //heroH5experience 英雄 H5 经验
    $heroH5physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH5experience = mysql_fetch_array($heroH5experience_query);

    //heroH5generals 英雄 H5 统率力
    $heroH5generals_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH5generals = mysql_fetch_array($heroH5generals_query);

    //heroH5power 英雄 H5 力量
    $heroH5power_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH5power = mysql_fetch_array($heroH5power_query);

    //heroH5agile 英雄 H5 敏捷
    $heroH5agile_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH5agile = mysql_fetch_array($heroH5agile_query);

    //heroH5brains 英雄 H5 智力
    $heroH5brains_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH5brains = mysql_fetch_array($heroH5brains_query);

    //heroH5state 英雄 H5 状态
    $heroH5state_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH5state = mysql_fetch_array($heroH5state_query);

    //heroH5forces 英雄 H5 兵力
    $heroH5forces_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH5forces = mysql_fetch_array($heroH5forces_query);
    
    //heroH6level 英雄 H6 级别
    $heroH6level_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH6level = mysql_fetch_array($heroH6level_query);

    //heroH6physical 英雄 H6 体力
    $heroH6physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH6physical = mysql_fetch_array($heroH6physical_query);

    //heroH6experience 英雄 H6 经验
    $heroH6physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH6experience = mysql_fetch_array($heroH6experience_query);

    //heroH6generals 英雄 H6 统率力
    $heroH6generals_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH6generals = mysql_fetch_array($heroH6generals_query);

    //heroH6power 英雄 H6 力量
    $heroH6power_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH6power = mysql_fetch_array($heroH6power_query);

    //heroH6agile 英雄 H6 敏捷
    $heroH6agile_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH6agile = mysql_fetch_array($heroH6agile_query);

    //heroH6brains 英雄 H6 智力
    $heroH6brains_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH6brains = mysql_fetch_array($heroH6brains_query);

    //heroH6state 英雄 H6 状态
    $heroH6state_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH6state = mysql_fetch_array($heroH6state_query);

    //heroH6forces 英雄 H6 兵力
    $heroH6forces_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH6forces = mysql_fetch_array($heroH6forces_query);

    //heroH7level 英雄 H7 级别
    $heroH7level_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH7level = mysql_fetch_array($heroH7level_query);

    //heroH7physical 英雄 H7 体力
    $heroH7physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH7physical = mysql_fetch_array($heroH7physical_query);

    //heroH7experience 英雄 H7 经验
    $heroH7physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH7experience = mysql_fetch_array($heroH7experience_query);

    //heroH7generals 英雄 H7 统率力
    $heroH7generals_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH7generals = mysql_fetch_array($heroH7generals_query);

    //heroH7power 英雄 H7 力量
    $heroH7power_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH7power = mysql_fetch_array($heroH7power_query);

    //heroH7agile 英雄 H7 敏捷
    $heroH7agile_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH7agile = mysql_fetch_array($heroH7agile_query);

    //heroH7brains 英雄 H7 智力
    $heroH7brains_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH7brains = mysql_fetch_array($heroH7brains_query);

    //heroH7state 英雄 H7 状态
    $heroH7state_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH7state = mysql_fetch_array($heroH7state_query);

    //heroH7forces 英雄 H7 兵力
    $heroH7forces_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH7forces = mysql_fetch_array($heroH7forces_query);

    //heroH8level 英雄 H8 级别
    $heroH8level_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH8level = mysql_fetch_array($heroH8level_query);

    //heroH8physical 英雄 H8 体力
    $heroH8physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH8physical = mysql_fetch_array($heroH8physical_query);

    //heroH8experience 英雄 H8 经验
    $heroH8physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH8experience = mysql_fetch_array($heroH8experience_query);

    //heroH8generals 英雄 H8 统率力
    $heroH8generals_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH8generals = mysql_fetch_array($heroH8generals_query);

    //heroH8power 英雄 H8 力量
    $heroH8power_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH8power = mysql_fetch_array($heroH8power_query);

    //heroH8agile 英雄 H8 敏捷
    $heroH8agile_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH8agile = mysql_fetch_array($heroH8agile_query);

    //heroH8brains 英雄 H8 智力
    $heroH8brains_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH8brains = mysql_fetch_array($heroH8brains_query);

    //heroH8state 英雄 H8 状态
    $heroH8state_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH8state = mysql_fetch_array($heroH8state_query);

    //heroH8forces 英雄 H8 兵力
    $heroH8forces_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH8forces = mysql_fetch_array($heroH8forces_query);

    //heroH9level 英雄 H9 级别
    $heroH9level_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH9level = mysql_fetch_array($heroH9level_query);

    //heroH9physical 英雄 H9 体力
    $heroH9physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH9physical = mysql_fetch_array($heroH9physical_query);

    //heroH9experience 英雄 H9 经验
    $heroH9physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH9experience = mysql_fetch_array($heroH9experience_query);

    //heroH9generals 英雄 H9 统率力
    $heroH9generals_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH9generals = mysql_fetch_array($heroH9generals_query);

    //heroH9power 英雄 H9 力量
    $heroH9power_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH9power = mysql_fetch_array($heroH9power_query);

    //heroH9agile 英雄 H9 敏捷
    $heroH9agile_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH9agile = mysql_fetch_array($heroH9agile_query);

    //heroH9brains 英雄 H9 智力
    $heroH9brains_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH9brains = mysql_fetch_array($heroH9brains_query);

    //heroH9state 英雄 H9 状态
    $heroH9state_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH9state = mysql_fetch_array($heroH9state_query);

    //heroH9forces 英雄 H9 兵力
    $heroH9forces_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH9forces = mysql_fetch_array($heroH9forces_query);

    //heroH10level 英雄 H10 级别
    $heroH10level_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH10level = mysql_fetch_array($heroH10level_query);

    //heroH10physical 英雄 H10 体力
    $heroH10physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH10physical = mysql_fetch_array($heroH10physical_query);

    //heroH10experience 英雄 H10 经验
    $heroH10physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH10experience = mysql_fetch_array($heroH10experience_query);

    //heroH10generals 英雄 H10 统率力
    $heroH10generals_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH10generals = mysql_fetch_array($heroH10generals_query);

    //heroH10power 英雄 H10 力量
    $heroH10power_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH10power = mysql_fetch_array($heroH10power_query);

    //heroH10agile 英雄 H10 敏捷
    $heroH10agile_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH10agile = mysql_fetch_array($heroH10agile_query);

    //heroH10brains 英雄 H10 智力
    $heroH10brains_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH10brains = mysql_fetch_array($heroH10brains_query);

    //heroH10state 英雄 H10 状态
    $heroH10state_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH10state = mysql_fetch_array($heroH10state_query);

    //heroH10forces 英雄 H10 兵力
    $heroH10forces_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH10forces = mysql_fetch_array($heroH10forces_query);

    //heroH11level 英雄 H11 级别
    $heroH11level_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH11level = mysql_fetch_array($heroH11level_query);

    //heroH11physical 英雄 H11 体力
    $heroH11physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH11physical = mysql_fetch_array($heroH11physical_query);

    //heroH11experience 英雄 H11 经验
    $heroH11physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH11experience = mysql_fetch_array($heroH11experience_query);

    //heroH11generals 英雄 H11 统率力
    $heroH11generals_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH11generals = mysql_fetch_array($heroH11generals_query);

    //heroH11power 英雄 H11 力量
    $heroH11power_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH11power = mysql_fetch_array($heroH11power_query);

    //heroH11agile 英雄 H11 敏捷
    $heroH11agile_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH11agile = mysql_fetch_array($heroH11agile_query);

    //heroH11brains 英雄 H11 智力
    $heroH11brains_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH11brains = mysql_fetch_array($heroH11brains_query);

    //heroH11state 英雄 H11 状态
    $heroH11state_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH11state = mysql_fetch_array($heroH11state_query);

    //heroH11forces 英雄 H11 兵力
    $heroH11forces_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH11forces = mysql_fetch_array($heroH11forces_query);


    //heroH12level 英雄 H12 级别
    $heroH12level_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH12level = mysql_fetch_array($heroH12level_query);

    //heroH12physical 英雄 H12 体力
    $heroH12physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH12physical = mysql_fetch_array($heroH12physical_query);

    //heroH12experience 英雄 H12 经验
    $heroH12physical_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH12experience = mysql_fetch_array($heroH12experience_query);

    //heroH12generals 英雄 H12 统率力
    $heroH12generals_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH12generals = mysql_fetch_array($heroH12generals_query);

    //heroH12power 英雄 H12 力量
    $heroH12power_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH12power = mysql_fetch_array($heroH12power_query);

    //heroH12agile 英雄 H12 敏捷
    $heroH12agile_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH12agile = mysql_fetch_array($heroH12agile_query);

    //heroH12brains 英雄 H12 智力
    $heroH12brains_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH12brains = mysql_fetch_array($heroH12brains_query);

    //heroH12state 英雄 H12 状态
    $heroH12state_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH12state = mysql_fetch_array($heroH12state_query);

    //heroH12forces 英雄 H12 兵力
    $heroH12forces_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $heroH12forces = mysql_fetch_array($heroH12forces_query);

    //innerCityA1 A1 - 内城 A1
    $innerCityA1_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $innerCityA1 = mysql_fetch_array($innerCityA1_query);
    //innerCityA2 A1 - 内城 A2
    $innerCityA2_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $innerCityA2 = mysql_fetch_array($innerCityA2_query);
    //innerCityA3 A1 - 内城 A3
    $innerCityA3_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $innerCityA3 = mysql_fetch_array($innerCityA3_query);
    //innerCityA4 A1 - 内城 A4
    $innerCityA4_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $innerCityA4 = mysql_fetch_array($innerCityA4_query);
    //innerCityA5 A1 - 内城 A5
    $innerCityA5_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $innerCityA5 = mysql_fetch_array($innerCityA5_query);
    //innerCityA6 A1 - 内城 A6
    $innerCityA6_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $innerCityA6 = mysql_fetch_array($innerCityA6_query);
    //innerCityA7 A1 - 内城 A7
    $innerCityA7_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $innerCityA7 = mysql_fetch_array($innerCityA7_query);
    
    //outerCityA1 A1 - 外城 A1
    $outerCityA1_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $outerCityA1 = mysql_fetch_array($outerCityA1_query);
    //outerCityA2 A1 - 外城 A2
    $outerCityA2_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $outerCityA2 = mysql_fetch_array($outerCityA2_query);
    //outerCityA3 A1 - 外城 A3
    $outerCityA3_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $outerCityA3 = mysql_fetch_array($outerCityA3_query);
    //outerCityA4 A1 - 外城 A4
    $outerCityA4_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $outerCityA4 = mysql_fetch_array($outerCityA4_query);
    //outerCityA5 A1 - 外城 A5
    $outerCityA5_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $outerCityA5 = mysql_fetch_array($outerCityA5_query);
    //outerCityA6 A1 - 外城 A6
    $outerCityA6_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $outerCityA6 = mysql_fetch_array($outerCityA6_query);
    //outerCityA7 A1 - 外城 A7
    $outerCityA7_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $outerCityA7 = mysql_fetch_array($outerCityA7_query);

    //outerCityA8 A1 - 外城 A8
    $outerCityA8_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $outerCityA8 = mysql_fetch_array($outerCityA8_query);
    //outerCityA9 A1 - 外城 A9
    $outerCityA9_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $outerCityA9 = mysql_fetch_array($outerCityA9_query);
    //outerCityA10 A1 - 外城 A10
    $outerCityA10_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $outerCityA10 = mysql_fetch_array($outerCityA10_query);
    //outerCityA11 A1 - 外城 A11
    $outerCityA11_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $outerCityA11 = mysql_fetch_array($outerCityA11_query);
    //outerCityA12 A1 - 外城 A12
    $outerCityA12_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $outerCityA12 = mysql_fetch_array($outerCityA12_query);
    //outerCityA13 A1 - 外城 A13
    $outerCityA13_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $outerCityA13 = mysql_fetch_array($outerCityA13_query);
    //outerCityA14 A1 - 外城 A14
    $outerCityA14_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $outerCityA14 = mysql_fetch_array($outerCityA14_query);

    //outerCityA15 A1 - 外城 A15
    $outerCityA15_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $outerCityA15 = mysql_fetch_array($outerCityA15_query);
    //outerCityA16 A1 - 外城 A16
    $outerCityA16_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $outerCityA16 = mysql_fetch_array($outerCityA16_query);

    //armyC1Total A1 - 军队 C1历史总生产
    $armyC1Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC1Total = mysql_fetch_array($armyC1Total_query);
    //armyC1Total A1 - 军队 C1现有
    $armyC1Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC1Total = mysql_fetch_array($armyC1Total_query);

    //armyC2Total A1 - 军队 C2历史总生产
    $armyC2Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC2Total = mysql_fetch_array($armyC2Total_query);
    //armyC2Total A1 - 军队 C2现有
    $armyC2Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC2Total = mysql_fetch_array($armyC2Total_query);

    //armyC3Total A1 - 军队 C3历史总生产
    $armyC3Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC3Total = mysql_fetch_array($armyC3Total_query);
    //armyC3Total A1 - 军队 C3现有
    $armyC3Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC3Total = mysql_fetch_array($armyC3Total_query);

    //armyC4Total A1 - 军队 C4历史总生产
    $armyC4Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC4Total = mysql_fetch_array($armyC4Total_query);
    //armyC4Total A1 - 军队 C4现有
    $armyC4Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC4Total = mysql_fetch_array($armyC4Total_query);

        //armyC5Total A1 - 军队 C5历史总生产
    $armyC5Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC5Total = mysql_fetch_array($armyC5Total_query);
    //armyC5Total A1 - 军队 C5现有
    $armyC5Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC5Total = mysql_fetch_array($armyC5Total_query);

        //armyC6Total A1 - 军队 C6历史总生产
    $armyC6Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC6Total = mysql_fetch_array($armyC6Total_query);
    //armyC6Total A1 - 军队 C6现有
    $armyC6Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC6Total = mysql_fetch_array($armyC6Total_query);

        //armyC7Total A1 - 军队 C7历史总生产
    $armyC7Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC7Total = mysql_fetch_array($armyC7Total_query);
    //armyC7Total A1 - 军队 C7现有
    $armyC7Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC7Total = mysql_fetch_array($armyC7Total_query);

        //armyC8Total A1 - 军队 C8历史总生产
    $armyC8Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC8Total = mysql_fetch_array($armyC8Total_query);
    //armyC8Total A1 - 军队 C8现有
    $armyC8Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC8Total = mysql_fetch_array($armyC8Total_query);

        //armyC9Total A1 - 军队 C9历史总生产
    $armyC9Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC9Total = mysql_fetch_array($armyC9Total_query);
    //armyC9Total A1 - 军队 C9现有
    $armyC9Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC9Total = mysql_fetch_array($armyC9Total_query);

        //armyC10Total A1 - 军队 C10历史总生产
    $armyC10Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC10Total = mysql_fetch_array($armyC10Total_query);
    //armyC10Total A1 - 军队 C10现有
    $armyC10Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC10Total = mysql_fetch_array($armyC10Total_query);

        //armyC11Total A1 - 军队 C11历史总生产
    $armyC11Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC11Total = mysql_fetch_array($armyC11Total_query);
    //armyC11Total A1 - 军队 C11现有
    $armyC11Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC11Total = mysql_fetch_array($armyC11Total_query);

        //armyC12Total A1 - 军队 C12历史总生产
    $armyC12Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC12Total = mysql_fetch_array($armyC12Total_query);
    //armyC12Total A1 - 军队 C12现有
    $armyC12Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC12Total = mysql_fetch_array($armyC12Total_query);
  
         //armyC13Total A1 - 军队 C13历史总生产
    $armyC13Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC13Total = mysql_fetch_array($armyC13Total_query);
    //armyC13Total A1 - 军队 C13现有
    $armyC13Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC13Total = mysql_fetch_array($armyC13Total_query);

        //armyC14Total A1 - 军队 C14历史总生产
    $armyC14Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC14Total = mysql_fetch_array($armyC14Total_query);
    //armyC14Total A1 - 军队 C14现有
    $armyC14Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC14Total = mysql_fetch_array($armyC14Total_query);

    //armyC15Total A1 - 军队 C15历史总生产
    $armyC15Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC15Total = mysql_fetch_array($armyC15Total_query);
    //armyC15Total A1 - 军队 C15现有
    $armyC15Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC15Total = mysql_fetch_array($armyC15Total_query);

    //armyC16Total A1 - 军队 C16历史总生产
    $armyC16Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC16Total = mysql_fetch_array($armyC16Total_query);
    //armyC16Total A1 - 军队 C16现有
    $armyC16Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $armyC16Total = mysql_fetch_array($armyC16Total_query);


    //foodC1Total  - A1 - 粮食 C1 总
    $foodC1Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $foodC1Total = mysql_fetch_array($foodC1Total_query);
    //foodC1Now  - A1 - 粮食 C1 现有
    $foodC1Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $foodC1Now = mysql_fetch_array($foodC1Now_query);

    //woodC1Total  - A1 - 木头 C1 总
    $woodC1Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $woodC1Total = mysql_fetch_array($woodC1Total_query);
    //woodC1Now  - A1 - 木头 C1 现有
    $woodC1Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $woodC1Now = mysql_fetch_array($woodC1Now_query);

    //stoneC1Total  - A1 - 石头 C1 总
    $stoneC1Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $stoneC1Total = mysql_fetch_array($stoneC1Total_query);
    //stoneC1Now  - A1 - 石头 C1 现有
    $stoneC1Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $stoneC1Now = mysql_fetch_array($stoneC1Now_query);

    //ironC1Total  - A1 - 铁 C1 总
    $ironC1Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $ironC1Total = mysql_fetch_array($ironC1Total_query);
    //ironC1Now  - A1 - 铁 C1 现有
    $ironC1Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $ironC1Now = mysql_fetch_array($ironC1Now_query);

    //c1Forest  - A1 - c1 森林
    $c1Forest_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $c1Forest = mysql_fetch_array($c1Forest_query);
    //c1kuangdong  - A1 - c1 矿洞
    $c1kuangdong_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $c1kuangdong = mysql_fetch_array($c1kuangdong_query);

    //c1villages  - A1 - c1 村庄
    $c1villages_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $c1villages = mysql_fetch_array($c1villages_query);
    //c1Mountains  - A1 - c1 山脉
    $c1Mountains_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  deviceid ='$deviceid[deviceid]' ORDER BY date DESC LIMIT 1",$db);
    $c1Mountains = mysql_fetch_array($c1Mountains_query);

    //innerCityA1 A2 - 内城 A1
    $a2_innerCityA1_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_innerCityA1 = mysql_fetch_array($a2_innerCityA1_query);
    //innerCityA2 A2 - 内城 A2
    $a2_innerCityA2_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_innerCityA2 = mysql_fetch_array($a2_innerCityA2_query);
    //innerCityA3 A2 - 内城 A3
    $a2_innerCityA3_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_innerCityA3 = mysql_fetch_array($a2_innerCityA3_query);
    //innerCityA4 A2 - 内城 A4
    $a2_innerCityA4_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_innerCityA4 = mysql_fetch_array($a2_innerCityA4_query);
    //innerCityA5 A2 - 内城 A5
    $a2_innerCityA5_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_innerCityA5 = mysql_fetch_array($a2_innerCityA5_query);
    //innerCityA6 A2 - 内城 A6
    $a2_innerCityA6_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_innerCityA6 = mysql_fetch_array($a2_innerCityA6_query);
    //innerCityA7 A2 - 内城 A7
    $a2_innerCityA7_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_innerCityA7 = mysql_fetch_array($a2_innerCityA7_query);
    
    //outerCityA1 A2 - 外城 A1
    $a2_outerCityA1_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_outerCityA1 = mysql_fetch_array($a2_outerCityA1_query);
    //outerCityA2 A2 - 外城 A2
    $a2_outerCityA2_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_outerCityA2 = mysql_fetch_array($a2_outerCityA2_query);
    //outerCityA3 A2 - 外城 A3
    $a2_outerCityA3_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_outerCityA3 = mysql_fetch_array($a2_outerCityA3_query);
    //outerCityA4 A2 - 外城 A4
    $a2_outerCityA4_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_outerCityA4 = mysql_fetch_array($a2_outerCityA4_query);
    //outerCityA5 A2 - 外城 A5
    $a2_outerCityA5_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_outerCityA5 = mysql_fetch_array($a2_outerCityA5_query);
    //outerCityA6 A2 - 外城 A6
    $a2_outerCityA6_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_outerCityA6 = mysql_fetch_array($a2_outerCityA6_query);
    //outerCityA7 A2 - 外城 A7
    $a2_outerCityA7_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_outerCityA7 = mysql_fetch_array($a2_outerCityA7_query);

    //outerCityA8 A2 - 外城 A8
    $a2_outerCityA8_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_outerCityA8 = mysql_fetch_array($a2_outerCityA8_query);
    //outerCityA9 A2 - 外城 A9
    $a2_outerCityA9_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_outerCityA9 = mysql_fetch_array($a2_outerCityA9_query);
    //outerCityA10 A2 - 外城 A10
    $a2_outerCityA10_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_outerCityA10 = mysql_fetch_array($a2_outerCityA10_query);
    //outerCityA11 A2 - 外城 A11
    $a2_outerCityA11_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_outerCityA11 = mysql_fetch_array($a2_outerCityA11_query);
    //outerCityA12 A2 - 外城 A12
    $a2_outerCityA12_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_outerCityA12 = mysql_fetch_array($a2_outerCityA12_query);
    //outerCityA13 A2 - 外城 A13
    $a2_outerCityA13_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_outerCityA13 = mysql_fetch_array($a2_outerCityA13_query);
    //outerCityA14 A2 - 外城 A24
    $a2_outerCityA14_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_outerCityA14 = mysql_fetch_array($a2_outerCityA14_query);

    //outerCityA15 A2 - 外城 A15
    $a2_outerCityA15_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_outerCityA15 = mysql_fetch_array($a2_outerCityA15_query);
    //outerCityA16 A2 - 外城 A16
    $a2_outerCityA16_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_outerCityA16 = mysql_fetch_array($a2_outerCityA16_query);

    //armyC1Total A2 - 军队 C1历史总生产
    $a2_armyC1Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC1Total = mysql_fetch_array($a2_armyC1Total_query);
    //armyC1Total A2 - 军队 C1现有
    $a2_armyC1Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC1Total = mysql_fetch_array($a2_armyC1Total_query);

    //armyC2Total A2 - 军队 C2历史总生产
    $a2_armyC2Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC2Total = mysql_fetch_array($a2_armyC2Total_query);
    //armyC2Total A2 - 军队 C2现有
    $a2_armyC2Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC2Total = mysql_fetch_array($a2_armyC2Total_query);

    //armyC3Total A2 - 军队 C3历史总生产
    $a2_armyC3Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC3Total = mysql_fetch_array($a2_armyC3Total_query);
    //armyC3Total A2 - 军队 C3现有
    $a2_armyC3Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC3Total = mysql_fetch_array($a2_armyC3Total_query);

    //armyC4Total A2 - 军队 C4历史总生产
    $a2_armyC4Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC4Total = mysql_fetch_array($a2_armyC4Total_query);
    //armyC4Total A2 - 军队 C4现有
    $a2_armyC4Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC4Total = mysql_fetch_array($a2_armyC4Total_query);

        //armyC5Total A2 - 军队 C5历史总生产
    $a2_armyC5Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC5Total = mysql_fetch_array($a2_armyC5Total_query);
    //armyC5Total A2 - 军队 C5现有
    $a2_armyC5Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC5Total = mysql_fetch_array($a2_armyC5Total_query);

        //armyC6Total A2 - 军队 C6历史总生产
    $a2_armyC6Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC6Total = mysql_fetch_array($a2_armyC6Total_query);
    //armyC6Total A2 - 军队 C6现有
    $a2_armyC6Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC6Total = mysql_fetch_array($a2_armyC6Total_query);

        //armyC7Total A2 - 军队 C7历史总生产
    $a2_armyC7Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC7Total = mysql_fetch_array($a2_armyC7Total_query);
    //armyC7Total A2 - 军队 C7现有
    $a2_armyC7Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC7Total = mysql_fetch_array($a2_armyC7Total_query);

        //armyC8Total A2 - 军队 C8历史总生产
    $a2_armyC8Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC8Total = mysql_fetch_array($a2_armyC8Total_query);
    //armyC8Total A2 - 军队 C8现有
    $a2_armyC8Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC8Total = mysql_fetch_array($a2_armyC8Total_query);

        //armyC9Total A2 - 军队 C9历史总生产
    $a2_armyC9Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC9Total = mysql_fetch_array($a2_armyC9Total_query);
    //armyC9Total A2 - 军队 C9现有
    $a2_armyC9Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC9Total = mysql_fetch_array($a2_armyC9Total_query);

        //armyC10Total A2 - 军队 C10历史总生产
    $a2_armyC10Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC10Total = mysql_fetch_array($a2_armyC10Total_query);
    //armyC10Total A2 - 军队 C10现有
    $a2_armyC10Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC10Total = mysql_fetch_array($a2_armyC10Total_query);

        //armyC11Total A2 - 军队 C11历史总生产
    $a2_armyC11Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC11Total = mysql_fetch_array($a2_armyC11Total_query);
    //armyC11Total A2 - 军队 C11现有
    $a2_armyC11Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC11Total = mysql_fetch_array($a2_armyC11Total_query);

        //armyC12Total A2 - 军队 C12历史总生产
    $a2_armyC12Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC12Total = mysql_fetch_array($a2_armyC12Total_query);
    //armyC12Total A2 - 军队 C12现有
    $a2_armyC12Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC12Total = mysql_fetch_array($a2_armyC12Total_query);
  
         //armyC13Total A2 - 军队 C13历史总生产
    $a2_armyC13Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC13Total = mysql_fetch_array($a2_armyC13Total_query);
    //armyC13Total A2 - 军队 C13现有
    $a2_armyC13Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC13Total = mysql_fetch_array($a2_armyC13Total_query);

        //armyC14Total A2 - 军队 C14历史总生产
    $a2_armyC14Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC14Total = mysql_fetch_array($a2_armyC14Total_query);
    //armyC14Total A2 - 军队 C14现有
    $a2_armyC14Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC14Total = mysql_fetch_array($a2_armyC14Total_query);

    //armyC15Total A2 - 军队 C15历史总生产
    $a2_armyC15Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC15Total = mysql_fetch_array($a2_armyC15Total_query);
    //armyC15Total A2 - 军队 C15现有
    $a2_armyC15Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC15Total = mysql_fetch_array($a2_armyC15Total_query);

    //armyC16Total A2 - 军队 C16历史总生产
    $a2_armyC16Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC16Total = mysql_fetch_array($a2_armyC16Total_query);
    //armyC16Total A2 - 军队 C16现有
    $a2_armyC16Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_armyC16Total = mysql_fetch_array($a2_armyC16Total_query);


    //foodC1Total  - A2 - 粮食 C1 总
    $a2_foodC1Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_foodC1Total = mysql_fetch_array($a2_foodC1Total_query);
    //foodC1Now  - A2 - 粮食 C1 现有
    $a2_foodC1Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_foodC1Now = mysql_fetch_array($a2_foodC1Now_query);

    //woodC1Total  - A2 - 木头 C1 总
    $a2_woodC1Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_woodC1Total = mysql_fetch_array($a2_woodC1Total_query);
    //woodC1Now  - A2 - 木头 C1 现有
    $a2_woodC1Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_woodC1Now = mysql_fetch_array($a2_woodC1Now_query);

    //stoneC1Total  - A2 - 石头 C1 总
    $a2_stoneC1Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_stoneC1Total = mysql_fetch_array($a2_stoneC1Total_query);
    //stoneC1Now  - A2 - 石头 C1 现有
    $a2_stoneC1Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_stoneC1Now = mysql_fetch_array($a2_stoneC1Now_query);

    //ironC1Total  - A2 - 铁 C1 总
    $a2_ironC1Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_ironC1Total = mysql_fetch_array($a2_ironC1Total_query);
    //ironC1Now  - A2 - 铁 C1 现有
    $a2_ironC1Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_ironC1Now = mysql_fetch_array($a2_ironC1Now_query);

    //c1Forest  - A2 - c1 森林
    $a2_c1Forest_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_c1Forest = mysql_fetch_array($a2_c1Forest_query);
    //c1kuangdong  - A2 - c1 矿洞
    $a2_c1kuangdong_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_c1kuangdong = mysql_fetch_array($a2_c1kuangdong_query);

    //c1villages  - A2 - c1 村庄
    $a2_c1villages_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_c1villages = mysql_fetch_array($a2_c1villages_query);
    //c1Mountains  - A2 - c1 山脉
    $a2_c1Mountains_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a2_everylogdate[date]'",$db);
    $a2_c1Mountains = mysql_fetch_array($a2_c1Mountains_query);

    //innerCityA1 A3 - 内城 A1
    $a3_innerCityA1_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_innerCityA1 = mysql_fetch_array($a3_innerCityA1_query);
    //innerCityA2 A3 - 内城 A2
    $a3_innerCityA2_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_innerCityA2 = mysql_fetch_array($a3_innerCityA2_query);
    //innerCityA3 A3 - 内城 A3
    $a3_innerCityA3_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_innerCityA3 = mysql_fetch_array($a3_innerCityA3_query);
    //innerCityA4 A3 - 内城 A4
    $a3_innerCityA4_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_innerCityA4 = mysql_fetch_array($a3_innerCityA4_query);
    //innerCityA5 A3 - 内城 A5
    $a3_innerCityA5_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_innerCityA5 = mysql_fetch_array($a3_innerCityA5_query);
    //innerCityA6 A3 - 内城 A6
    $a3_innerCityA6_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_innerCityA6 = mysql_fetch_array($a3_innerCityA6_query);
    //innerCityA7 A3 - 内城 A7
    $a3_innerCityA7_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_innerCityA7 = mysql_fetch_array($a3_innerCityA7_query);
    
    //outerCityA1 A3 - 外城 A1
    $a3_outerCityA1_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_outerCityA1 = mysql_fetch_array($a3_outerCityA1_query);
    //outerCityA2 A3 - 外城 A2
    $a3_outerCityA2_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_outerCityA2 = mysql_fetch_array($a3_outerCityA2_query);
    //outerCityA3 A3 - 外城 A3
    $a3_outerCityA3_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_outerCityA3 = mysql_fetch_array($a3_outerCityA3_query);
    //outerCityA4 A3 - 外城 A4
    $a3_outerCityA4_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_outerCityA4 = mysql_fetch_array($a3_outerCityA4_query);
    //outerCityA5 A3 - 外城 A5
    $a3_outerCityA5_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_outerCityA5 = mysql_fetch_array($a3_outerCityA5_query);
    //outerCityA6 A3 - 外城 A6
    $a3_outerCityA6_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_outerCityA6 = mysql_fetch_array($a3_outerCityA6_query);
    //outerCityA7 A3 - 外城 A7
    $a3_outerCityA7_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_outerCityA7 = mysql_fetch_array($a3_outerCityA7_query);

    //outerCityA8 A3 - 外城 A8
    $a3_outerCityA8_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_outerCityA8 = mysql_fetch_array($a3_outerCityA8_query);
    //outerCityA9 A3 - 外城 A9
    $a3_outerCityA9_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_outerCityA9 = mysql_fetch_array($a3_outerCityA9_query);
    //outerCityA10 A3 - 外城 A10
    $a3_outerCityA10_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_outerCityA10 = mysql_fetch_array($a3_outerCityA10_query);
    //outerCityA11 A3 - 外城 A11
    $a3_outerCityA11_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_outerCityA11 = mysql_fetch_array($a3_outerCityA11_query);
    //outerCityA12 A3 - 外城 A12
    $a3_outerCityA12_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_outerCityA12 = mysql_fetch_array($a3_outerCityA12_query);
    //outerCityA13 A3 - 外城 A13
    $a3_outerCityA13_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_outerCityA13 = mysql_fetch_array($a3_outerCityA13_query);
    //outerCityA14 A3 - 外城 A14
    $a3_outerCityA14_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_outerCityA14 = mysql_fetch_array($a3_outerCityA14_query);

    //outerCityA15 A3 - 外城 A15
    $a3_outerCityA15_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_outerCityA15 = mysql_fetch_array($a3_outerCityA15_query);
    //outerCityA16 A3 - 外城 A16
    $a3_outerCityA16_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_outerCityA16 = mysql_fetch_array($a3_outerCityA16_query);

    //armyC1Total A3 - 军队 C1历史总生产
    $a3_armyC1Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC1Total = mysql_fetch_array($a3_armyC1Total_query);
    //armyC1Total A3 - 军队 C1现有
    $a3_armyC1Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC1Total = mysql_fetch_array($a3_armyC1Total_query);

    //armyC2Total A3 - 军队 C2历史总生产
    $a3_armyC2Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC2Total = mysql_fetch_array($a3_armyC2Total_query);
    //armyC2Total A3 - 军队 C2现有
    $a3_armyC2Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC2Total = mysql_fetch_array($a3_armyC2Total_query);

    //armyC3Total A3 - 军队 C3历史总生产
    $a3_armyC3Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC3Total = mysql_fetch_array($a3_armyC3Total_query);
    //armyC3Total A3 - 军队 C3现有
    $a3_armyC3Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC3Total = mysql_fetch_array($a3_armyC3Total_query);

    //armyC4Total A3 - 军队 C4历史总生产
    $a3_armyC4Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC4Total = mysql_fetch_array($a3_armyC4Total_query);
    //armyC4Total A3 - 军队 C4现有
    $a3_armyC4Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC4Total = mysql_fetch_array($a3_armyC4Total_query);

        //armyC5Total A3 - 军队 C5历史总生产
    $a3_armyC5Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC5Total = mysql_fetch_array($a3_armyC5Total_query);
    //armyC5Total A3 - 军队 C5现有
    $a3_armyC5Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC5Total = mysql_fetch_array($a3_armyC5Total_query);

        //armyC6Total A3 - 军队 C6历史总生产
    $a3_armyC6Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC6Total = mysql_fetch_array($a3_armyC6Total_query);
    //armyC6Total A3 - 军队 C6现有
    $a3_armyC6Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC6Total = mysql_fetch_array($a3_armyC6Total_query);

        //armyC7Total A3 - 军队 C7历史总生产
    $a3_armyC7Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC7Total = mysql_fetch_array($a3_armyC7Total_query);
    //armyC7Total A3 - 军队 C7现有
    $a3_armyC7Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC7Total = mysql_fetch_array($a3_armyC7Total_query);

        //armyC8Total A3 - 军队 C8历史总生产
    $a3_armyC8Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC8Total = mysql_fetch_array($a3_armyC8Total_query);
    //armyC8Total A3 - 军队 C8现有
    $a3_armyC8Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC8Total = mysql_fetch_array($a3_armyC8Total_query);

        //armyC9Total A3 - 军队 C9历史总生产
    $a3_armyC9Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC9Total = mysql_fetch_array($a3_armyC9Total_query);
    //armyC9Total A3 - 军队 C9现有
    $a3_armyC9Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC9Total = mysql_fetch_array($a3_armyC9Total_query);

        //armyC10Total A3 - 军队 C10历史总生产
    $a3_armyC10Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC10Total = mysql_fetch_array($a3_armyC10Total_query);
    //armyC10Total A3 - 军队 C10现有
    $a3_armyC10Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC10Total = mysql_fetch_array($a3_armyC10Total_query);

        //armyC11Total A3 - 军队 C11历史总生产
    $a3_armyC11Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC11Total = mysql_fetch_array($a3_armyC11Total_query);
    //armyC11Total A3 - 军队 C11现有
    $a3_armyC11Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC11Total = mysql_fetch_array($a3_armyC11Total_query);

        //armyC12Total A3 - 军队 C12历史总生产
    $a3_armyC12Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC12Total = mysql_fetch_array($a3_armyC12Total_query);
    //armyC12Total A3 - 军队 C12现有
    $a3_armyC12Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC12Total = mysql_fetch_array($a3_armyC12Total_query);
  
         //armyC13Total A3 - 军队 C13历史总生产
    $a3_armyC13Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC13Total = mysql_fetch_array($a3_armyC13Total_query);
    //armyC13Total A3 - 军队 C13现有
    $a3_armyC13Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC13Total = mysql_fetch_array($a3_armyC13Total_query);

        //armyC14Total A3 - 军队 C14历史总生产
    $a3_armyC14Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC14Total = mysql_fetch_array($a3_armyC14Total_query);
    //armyC14Total A3 - 军队 C14现有
    $a3_armyC14Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC14Total = mysql_fetch_array($a3_armyC14Total_query);

    //armyC15Total A3 - 军队 C15历史总生产
    $a3_armyC15Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC15Total = mysql_fetch_array($a3_armyC15Total_query);
    //armyC15Total A3 - 军队 C15现有
    $a3_armyC15Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC15Total = mysql_fetch_array($a3_armyC15Total_query);

    //armyC16Total A3 - 军队 C16历史总生产
    $a3_armyC16Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC16Total = mysql_fetch_array($a3_armyC16Total_query);
    //armyC16Total A3 - 军队 C16现有
    $a3_armyC16Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_armyC16Total = mysql_fetch_array($a3_armyC16Total_query);


    //foodC1Total  - A3 - 粮食 C1 总
    $a3_foodC1Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_foodC1Total = mysql_fetch_array($a3_foodC1Total_query);
    //foodC1Now  - A3 - 粮食 C1 现有
    $a3_foodC1Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_foodC1Now = mysql_fetch_array($a3_foodC1Now_query);

    //woodC1Total  - A3 - 木头 C1 总
    $a3_woodC1Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_woodC1Total = mysql_fetch_array($a3_woodC1Total_query);
    //woodC1Now  - A3 - 木头 C1 现有
    $a3_woodC1Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_woodC1Now = mysql_fetch_array($a3_woodC1Now_query);

    //stoneC1Total  - A3 - 石头 C1 总
    $a3_stoneC1Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_stoneC1Total = mysql_fetch_array($a3_stoneC1Total_query);
    //stoneC1Now  - A3 - 石头 C1 现有
    $a3_stoneC1Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_stoneC1Now = mysql_fetch_array($a3_stoneC1Now_query);

    //ironC1Total  - A3 - 铁 C1 总
    $a3_ironC1Total_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_ironC1Total = mysql_fetch_array($a3_ironC1Total_query);
    //ironC1Now  - A3 - 铁 C1 现有
    $a3_ironC1Now_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_ironC1Now = mysql_fetch_array($a3_ironC1Now_query);

    //c1Forest  - A3 - c1 森林
    $a3_c1Forest_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_c1Forest = mysql_fetch_array($a3_c1Forest_query);
    //c1kuangdong  - A3 - c1 矿洞
    $a3_c1kuangdong_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_c1kuangdong = mysql_fetch_array($a3_c1kuangdong_query);

    //c1villages  - A3 - c1 村庄
    $a3_c1villages_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_c1villages = mysql_fetch_array($a3_c1villages_query);
    //c1Mountains  - A3 - c1 山脉
    $a3_c1Mountains_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $a3_c1Mountains = mysql_fetch_array($a3_c1Mountains_query);

    //props_1  1 道具 数量
    $props_1_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $props_1 = mysql_fetch_array($props_1_query);

    //props_2  2 道具 数量
    $props_2_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $props_2 = mysql_fetch_array($props_2_query);
    //props_3  3 道具 数量
    $props_3_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $props_3 = mysql_fetch_array($props_3_query);
    //props_4  4 道具 数量
    $props_4_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $props_4 = mysql_fetch_array($props_4_query);
    //props_5  5 道具 数量
    $props_5_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $props_5 = mysql_fetch_array($props_5_query);
    //props_6  6 道具 数量
    $props_6_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $props_6 = mysql_fetch_array($props_6_query);
    //props_7  7 道具 数量
    $props_7_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $props_7 = mysql_fetch_array($props_7_query);
    //props_8  8 道具 数量
    $props_8_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $props_8 = mysql_fetch_array($props_8_query);
    //props_9  9 道具 数量
    $props_9_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $props_9 = mysql_fetch_array($props_9_query);
    //props_10  10 道具 数量
    $props_10_query = mysql_query("SELECT DISTINCT deviceid  FROM  faithwar  where  date ='$a3_everylogdate[date]'",$db);
    $props_10 = mysql_fetch_array($props_10_query);



$sql="REPLACE INTO report_nojailbreak (firstlogindata,
      firstlogin,
      LastLogin,
      LastLoginIp,
      prestige,
      prestigeLevel,
      warvictory,
      TownNum,
      goldIncome,
      goldUsed,
      goldNow,
      TcUsedNum,
      TcInventoryNum,
      rechargeTotal,
      rechargeToday,
      rechargeTotalTime,
      rechargeTodayTime,
      technologyT1,
      technologyT2,
      technologyT3,
      technologyT4,
      technologyT5,
      technologyT6,
      technologyT7,
      technologyT8,
      technologyT9,
      technologyT10,
      technologyT11,
      technologyT12,
      technologyT13,
      technologyT14,
      technologyT15,
      heroNum,
      heroH1level,
      heroH1physica,
      heroH1experience,
      heroH1generals,
      heroH1power,
      heroH1agile,
      heroH1brains,
      heroH1state,
      heroH1forces,
      heroH2level,
      heroH2physical,
      heroH2experience,
      heroH2generals,
      heroH2power,
      heroH2agile,
      heroH2brains,
      heroH2state,
      heroH2force,
      heroH3level,
      heroH3physical,
      heroH3experience,
      heroH3generals,
      heroH3power,
      heroH3agile,
      heroH3brains,
      heroH3state,
      heroH3forces,
      heroH4level,
      heroH4physical,
      heroH4experience,
      heroH4generals,
      heroH4power,
      heroH4agile,
      heroH4brains,
      heroH4state,
      heroH4forces,
      heroH5level,
      heroH5physical,
      heroH5experience,
      heroH5generals,
      heroH5power,
      heroH5agile,
      heroH5brains,
      heroH5state,
      heroH5forces,
      heroH6level,
      heroH6physical,
      heroH6experience,
      heroH6generals,
      heroH6power,
      heroH6agile,
      heroH6brains,
      heroH6state,
      heroH6forces,
      heroH7level,
      heroH7physical,
      heroH7experience,
      heroH7generals,
      heroH7power,
      heroH7agile,
      heroH7brains,
      heroH7state,
      heroH7forces,
      heroH8level,
      heroH8physical,
      heroH8experience,
      heroH8generals,
      heroH8power,
      heroH8agile,
      heroH8brains,
      heroH8state,
      heroH8forces,
      heroH9level,
      heroH9physical,
      heroH9experience,
      heroH9generals,
      heroH9power,
      heroH9agile,
      heroH9brains,
      heroH9state,
      heroH9forces,
      heroH10level,
      heroH10physical,
      heroH10experience,
      heroH10generals,
      heroH10power,
      heroH10agile,
      heroH10brains,
      heroH10state,
      heroH10forces,
      heroH11level,
      heroH11physical,
      heroH11experience,
      heroH11generals,
      heroH11power,
      heroH11agile,
      heroH11brains,
      heroH11state,
      heroH11forces,
      heroH12level,
      heroH12physical,
      heroH12experience,
      heroH12generals,
      heroH12power,
      heroH12agile',
      heroH12brains,
      heroH12state,
      heroH12forces,
      innerCityA1,
      innerCityA2,
      innerCityA3,
      innerCityA4,
      innerCityA5,
      innerCityA6,
      innerCityA7,
      outerCityA1,
      outerCityA2,
      outerCityA3,
      outerCityA4,
      outerCityA5,
      outerCityA6,
      outerCityA7,
      outerCityA8,
      outerCityA9,
      outerCityA10,
      outerCityA11,
      outerCityA12,
      outerCityA13,
      outerCityA14,
      outerCityA15,
      outerCityA16,
      armyC1Total,
      armyC1Now,
      armyC2Total,
      armyC2Now,
      armyC3Total,
      armyC3Now,
      armyC4Total,
      armyC4Now,
      armyC5Total,
      armyC5Now,
      armyC6Total,
      armyC6Now,
      armyC7Total,
      armyC7Now,
      armyC8Total,
      armyC8Now,
      armyC9Total,
      armyC9Now,
      armyC10Total,
      armyC10Now,
      armyC11Total,
      armyC11Now,
      armyC12Total,
      armyC12Now,
      armyC13Total, 
      armyC13Now,
      armyC14Total,
      armyC14Now,
      armyC15Total,
      armyC15Now,
      armyC16Total,
      armyC16Now,
      foodC1Total,
      foodC1Now,
      woodC1Total,
      woodC1Now,
      stoneC1Total,
      stoneC1Now,
      ironC1Total,
      ironC1Now,
      c1Forest,
      c1kuangdong,
      c1villages,
      c1Mountains,
      a2_innerCityA1,
      a2_innerCityA2,
      a2_innerCityA3,
      a2_innerCityA4,
      a2_innerCityA5,
      a2_innerCityA6,
      a2_innerCityA7,
      a2_outerCityA1,
      a2_outerCityA2,
      a2_outerCityA3,
      a2_outerCityA4,
      a2_outerCityA5,
      a2_outerCityA6,
      a2_outerCityA7,
      a2_outerCityA8,
      a2_outerCityA9,
      a2_outerCityA10,
      a2_outerCityA11,
      a2_outerCityA12,
      a2_outerCityA13,
      a2_outerCityA14,
      a2_outerCityA15,
      a2_outerCityA16,
      a2_armyC1Total,
      a2_armyC1Now,
      a2_armyC2Total,
      a2_armyC2Now,
      a2_armyC3Total,
      a2_armyC3Now,
      a2_armyC4Total,
      a2_armyC4Now,
      a2_armyC5Total,
      a2_armyC5Now,
      a2_armyC6Total,
      a2_armyC6Now,
      a2_armyC7Total,
      a2_armyC7Now,
      a2_armyC8Total,
      a2_armyC8Now,
      a2_armyC9Total,
      a2_armyC9Now,
      a2_armyC10Total,
      a2_armyC10Now,
      a2_armyC11Total,
      a2_armyC11Now,
      a2_armyC12Total,
      a2_armyC12Now,
      a2_armyC13Total,
      a2_armyC13Now,
      a2_armyC14Total,
      a2_armyC14Now,
      a2_armyC15Total,
      a2_armyC15Now,
      a2_armyC16Total,
      a2_armyC16Now,
      a2_foodC1Total,
      a2_foodC1Now,
      a2_woodC1Total,
      a2_woodC1Now,
      a2_stoneC1Total,
      a2_stoneC1Now,
      a2_ironC1Total,
      a2_ironC1Now,
      a2_c1Forest,
      a2_c1kuangdong,
      a2_c1villages,
      a2_c1Mountains,
      a3_innerCityA1,
      a3_innerCityA2,
      a3_innerCityA3,
      a3_innerCityA4,
      a3_innerCityA5,
      a3_innerCityA6,
      a3_innerCityA7,
      a3_outerCityA1,
      a3_outerCityA2,
      a3_outerCityA3,
      a3_outerCityA4,
      a3_outerCityA5,
      a3_outerCityA6,
      a3_outerCityA7,
      a3_outerCityA8,
      a3_outerCityA9,
      a3_outerCityA10,
      a3_outerCityA11,
      a3_outerCityA12,
      a3_outerCityA13,
      a3_outerCityA14,
      a3_outerCityA15,
      a3_outerCityA16,
      a3_armyC1Total,
      a3_armyC1Now,
      a3_armyC2Total,
      a3_armyC2Now,
      a3_armyC3Total,
      a3_armyC3Now,
      a3_armyC4Total,
      a3_armyC4Now,
      a3_armyC5Total,
      a3_armyC5Now,
      a3_armyC6Total,
      a3_armyC6Now,
      a3_armyC7Total,
      a3_armyC7Now,
      a3_armyC8Total,
      a3_armyC8Now,
      a3_armyC9Total,
      a3_armyC9Now,
      a3_armyC10Total,
      a3_armyC10Now,
      a3_armyC11Total,
      a3_armyC11Now,
      a3_armyC12Total,
      a3_armyC12Now,
      a3_armyC13Total,
      a3_armyC13Now,
      a3_armyC14Total,
      a3_armyC14Now,
      a3_armyC15Total,
      a3_armyC15Now,
      a3_armyC16Total,
      a3_armyC16Now,
      a3_foodC1Total,
      a3_foodC1Now,
      a3_woodC1Total,
      a3_woodC1Now,
      a3_stoneC1Total,
      a3_stoneC1Now,
      a3_ironC1Total,
      a3_ironC1Now,
      a3_c1Forest,
      a3_c1kuangdong,
      a3_c1villages,
      a3_c1Mountains,
      props_1,
      props_2,
      props_3,
      props_4,
      props_5,
      props_6,
      props_7,
      props_8,
      props_9,
      props_10,
      deviceid,
      createdate,
      date
          ) 
                  VALUES(  '$firstlogindata',
            '$firstlogin',
            '$LastLogin',
            '$LastLoginIp',
            '$prestige',
            '$prestigeLevel',
            '$warvictory',
            '$TownNum',
            '$goldIncome',
            '$goldUsed',
            '$goldNow',
            '$TcUsedNum',
            '$TcInventoryNum',
            '$rechargeTotal',
            '$rechargeToday',
            '$rechargeTotalTime',
            '$rechargeTodayTime',
            '$technologyT1',
            '$technologyT2',
            '$technologyT3',
            '$technologyT4',
            '$technologyT5',
            '$technologyT6',
            '$technologyT7',
            '$technologyT8',
            '$technologyT9',
            '$technologyT10',
            '$technologyT11',
            '$technologyT12',
            '$technologyT13',
            '$technologyT14',
            '$technologyT15',
            '$heroNum',
            '$heroH1level',
            '$heroH1physica',
            '$heroH1experience',
            '$heroH1generals',
            '$heroH1power',
            '$heroH1agile',
            '$heroH1brains',
            '$heroH1state',
            '$heroH1forces',
            '$heroH2level',
            '$heroH2physical',
            '$heroH2experience',
            '$heroH2generals',
            '$heroH2power',
            '$heroH2agile',
            '$heroH2brains',
            '$heroH2state',
            '$heroH2force',
            '$heroH3level',
            '$heroH3physical',
            '$heroH3experience',
            '$heroH3generals',
            '$heroH3power',
            '$heroH3agile',
            '$heroH3brains',
            '$heroH3state',
            '$heroH3forces',
            '$heroH4level',
            '$heroH4physical',
            '$heroH4experience',
            '$heroH4generals',
            '$heroH4power',
            '$heroH4agile',
            '$heroH4brains',
            '$heroH4state',
            '$heroH4forces',
            '$heroH5level',
            '$heroH5physical',
            '$heroH5experience',
            '$heroH5generals',
            '$heroH5power',
            '$heroH5agile',
            '$heroH5brains',
            '$heroH5state',
            '$heroH5forces',
            '$heroH6level',
            '$heroH6physical',
            '$heroH6experience',
            '$heroH6generals',
            '$heroH6power',
            '$heroH6agile',
            '$heroH6brains',
            '$heroH6state',
            '$heroH6forces',
            '$heroH7level',
            '$heroH7physical',
            '$heroH7experience',
            '$heroH7generals',
            '$heroH7power',
            '$heroH7agile',
            '$heroH7brains',
            '$heroH7state',
            '$heroH7forces',
            '$heroH8level',
            '$heroH8physical',
            '$heroH8experience',
            '$heroH8generals',
            '$heroH8power',
            '$heroH8agile',
            '$heroH8brains',
            '$heroH8state',
            '$heroH8forces',
            '$heroH9level',
            '$heroH9physical',
            '$heroH9experience',
            '$heroH9generals',
            '$heroH9power',
            '$heroH9agile',
            '$heroH9brains',
            '$heroH9state',
            '$heroH9forces',
            '$heroH10level',
            '$heroH10physical',
            '$heroH10experience',
            '$heroH10generals',
            '$heroH10power',
            '$heroH10agile',
            '$heroH10brains',
            '$heroH10state',
            '$heroH10forces',
            '$heroH11level',
            '$heroH11physical',
            '$heroH11experience',
            '$heroH11generals',
            '$heroH11power',
            '$heroH11agile',
            '$heroH11brains',
            '$heroH11state',
            '$heroH11forces',
            '$heroH12level',
            '$heroH12physical',
            '$heroH12experience',
            '$heroH12generals',
            '$heroH12power',
            '$heroH12agile'',
            '$heroH12brains',
            '$heroH12state',
            '$heroH12forces',
            '$innerCityA1',
            '$innerCityA2',
            '$innerCityA3',
            '$innerCityA4',
            '$innerCityA5',
            '$innerCityA6',
            '$innerCityA7',
            '$outerCityA1',
            '$outerCityA2',
            '$outerCityA3',
            '$outerCityA4',
            '$outerCityA5',
            '$outerCityA6',
            '$outerCityA7',
            '$outerCityA8',
            '$outerCityA9',
            '$outerCityA10',
            '$outerCityA11',
            '$outerCityA12',
            '$outerCityA13',
            '$outerCityA14',
            '$outerCityA15',
            '$outerCityA16',
            '$armyC1Total',
            '$armyC1Now',
            '$armyC2Total',
            '$armyC2Now',
            '$armyC3Total',
            '$armyC3Now',
            '$armyC4Total',
            '$armyC4Now',
            '$armyC5Total',
            '$armyC5Now',
            '$armyC6Total',
            '$armyC6Now',
            '$armyC7Total',
            '$armyC7Now',
            '$armyC8Total',
            '$armyC8Now',
            '$armyC9Total',
            '$armyC9Now',
            '$armyC10Total',
            '$armyC10Now',
            '$armyC11Total',
            '$armyC11Now',
            '$armyC12Total',
            '$armyC12Now',
            '$armyC13Total',
            '$armyC13Now',
            '$armyC14Total',
            '$armyC14Now',
            '$armyC15Total',
            '$armyC15Now',
            '$armyC16Total',
            '$armyC16Now',
            '$foodC1Total',
            '$foodC1Now',
            '$woodC1Total',
            '$woodC1Now',
            '$stoneC1Total',
            '$stoneC1Now',
            '$ironC1Total',
            '$ironC1Now',
            '$c1Forest',
            '$c1kuangdong',
            '$c1villages',
            '$c1Mountains',
            '$a2_innerCityA1',
            '$a2_innerCityA2',
            '$a2_innerCityA3',
            '$a2_innerCityA4',
            '$a2_innerCityA5',
            '$a2_innerCityA6',
            '$a2_innerCityA7',
            '$a2_outerCityA1',
            '$a2_outerCityA2',
            '$a2_outerCityA3',
            '$a2_outerCityA4',
            '$a2_outerCityA5',
            '$a2_outerCityA6',
            '$a2_outerCityA7',
            '$a2_outerCityA8',
            '$a2_outerCityA9',
            '$a2_outerCityA10',
            '$a2_outerCityA11',
            '$a2_outerCityA12',
            '$a2_outerCityA13',
            '$a2_outerCityA14',
            '$a2_outerCityA15',
            '$a2_outerCityA16',
            '$a2_armyC1Total',
            '$a2_armyC1Now',
            '$a2_armyC2Total',
            '$a2_armyC2Now',
            '$a2_armyC3Total',
            '$a2_armyC3Now',
            '$a2_armyC4Total',
            '$a2_armyC4Now',
            '$a2_armyC5Total',
            '$a2_armyC5Now',
            '$a2_armyC6Total',
            '$a2_armyC6Now',
            '$a2_armyC7Total',
            '$a2_armyC7Now',
            '$a2_armyC8Total',
            '$a2_armyC8Now',
            '$a2_armyC9Total',
            '$a2_armyC9Now',
            '$a2_armyC10Total',
            '$a2_armyC10Now',
            '$a2_armyC11Total',
            '$a2_armyC11Now',
            '$a2_armyC12Total',
            '$a2_armyC12Now',
            '$a2_armyC13Total',
            '$a2_armyC13Now',
            '$a2_armyC14Total',
            '$a2_armyC14Now',
            '$a2_armyC15Total',
            '$a2_armyC15Now',
            '$a2_armyC16Total',
            '$a2_armyC16Now',
            '$a2_foodC1Total',
            '$a2_foodC1Now',
            '$a2_woodC1Total',
            '$a2_woodC1Now',
            '$a2_stoneC1Total',
            '$a2_stoneC1Now',
            '$a2_ironC1Total',
            '$a2_ironC1Now',
            '$a2_c1Forest',
            '$a2_c1kuangdong',
            '$a2_c1villages',
            '$a2_c1Mountains',
            '$a3_innerCityA1',
            '$a3_innerCityA2',
            '$a3_innerCityA3',
            '$a3_innerCityA4',
            '$a3_innerCityA5',
            '$a3_innerCityA6',
            '$a3_innerCityA7',
            '$a3_outerCityA1',
            '$a3_outerCityA2',
            '$a3_outerCityA3',
            '$a3_outerCityA4',
            '$a3_outerCityA5',
            '$a3_outerCityA6',
            '$a3_outerCityA7',
            '$a3_outerCityA8',
            '$a3_outerCityA9',
            '$a3_outerCityA10',
            '$a3_outerCityA11',
            '$a3_outerCityA12',
            '$a3_outerCityA13',
            '$a3_outerCityA14',
            '$a3_outerCityA15',
            '$a3_outerCityA16',
            '$a3_armyC1Total',
            '$a3_armyC1Now',
            '$a3_armyC2Total',
            '$a3_armyC2Now',
            '$a3_armyC3Total',
            '$a3_armyC3Now',
            '$a3_armyC4Total',
            '$a3_armyC4Now',
            '$a3_armyC5Total',
            '$a3_armyC5Now',
            '$a3_armyC6Total',
            '$a3_armyC6Now',
            '$a3_armyC7Total',
            '$a3_armyC7Now',
            '$a3_armyC8Total',
            '$a3_armyC8Now',
            '$a3_armyC9Total',
            '$a3_armyC9Now',
            '$a3_armyC10Total',
            '$a3_armyC10Now',
            '$a3_armyC11Total',
            '$a3_armyC11Now',
            '$a3_armyC12Total',
            '$a3_armyC12Now',
            '$a3_armyC13Total',
            '$a3_armyC13Now',
            '$a3_armyC14Total',
            '$a3_armyC14Now',
            '$a3_armyC15Total',
            '$a3_armyC15Now',
            '$a3_armyC16Total',
            '$a3_armyC16Now',
            '$a3_foodC1Total',
            '$a3_foodC1Now',
            '$a3_woodC1Total',
            '$a3_woodC1Now',
            '$a3_stoneC1Total',
            '$a3_stoneC1Now',
            '$a3_ironC1Total',
            '$a3_ironC1Now',
            '$a3_c1Forest',
            '$a3_c1kuangdong',
            '$a3_c1villages',
            '$a3_c1Mountains',
            '$props_1',
            '$props_2',
            '$props_3',
            '$props_4',
            '$props_5',
            '$props_6',
            '$props_7',
            '$props_8',
            '$props_9',
            '$props_10',
            '$deviceid',
            '$createdate',
            '$date
                )";
$query= @mysql_query($sql,$db) or die(mysql_error());  

}
?>
